import java.util.Scanner;

public class test5 {
    //递归求斐波那契数列的第 N 项
    public static void main(String[] args) {
        System.out.println("输入数字n:");
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int f = getF(n);
        System.out.println("第"+n+"项斐波那契数为:"+f);
    }
    public static int getF(int n){
        if(n<=2){
            return 1;
        }else{
            return getF(n-1)+getF(n-2);
        }
    }
}
